import request from "@/utils/request";
/**
 * 获取兑换码关联的权益包
 * http://192.168.88.247:4999/web/#/105/1334
 * @param {*} params
 * @returns
 */
export function exchangeCodeResource(params: any) {
  return request({
    url: "/api/v2/exchange_code/rel_resource",
    method: "get",
    params
  });
}
/**
 * 用户使用兑换码兑换
 * http://192.168.88.247:4999/web/#/105/1333
 * @param {*} data
 * @returns
 */
export function actExchangeCode(data: any) {
  return request({
    url: "/api/v1/exchange_code/exchange",
    method: "post",
    data
  });
}
/**
 * 获取用户订单列表
 * http://192.168.88.247:4999/web/#/105/1342
 * @param {*} params
 * @returns
 */
export function orderListApi(params: any) {
  return request({
    url: "/api/v1/order/user_list",
    method: "get",
    params
  });
}
/**
 * 用户兑换列表
 * http://192.168.88.247:4999/web/#/105/1335
 * @param {*} params
 * @returns
 */
export function exchangeListApi(params: any) {
  return request({
    url: "/api/v1/exchange_code/exchange_list",
    method: "get",
    params
  });
}

/**
 * 翻译币明细
 * http://192.168.88.247:4999/web/#/283?page_id=2492
 * @param {*} params
 * @returns
 */
export function tsbOrderListApi(params: any) {
  return request({
    url: "/charge/api/v1/user/bills",
    method: "get",
    params
  });
}

/**
 * 签约列表
 * http://showdoc.wisetimes.cn:4999/web/#/105/2056
 * @param {*} params
 * @returns
 */
export function signPayListApi(params: any, noMsg: boolean) {
  return request({
    noMsg: noMsg ?? true,
    url: "/api/v1/agreement/status/opened",
    method: "get",
    params
  });
}

/**
 * 解约
 * http://showdoc.wisetimes.cn:4999/web/#/105/2057
 * @param {*} data
 * @returns
 */
export function unsignPayApi(data: any) {
  return request({
    url: "/api/v1/agreement/unsign",
    method: "post",
    data
  });
}
